import service from "../index";
import type {ApiResponse} from '../index'

export interface User {
    uuid: string;
    username: string;
    email: string;
    password:string;
    phone:string;
    sex:string;
    qq:string;
    id:number;
}

export interface emailLoginRequest{
    email:string;
    password:string;
}

export interface emailLoginResponse{
    user: User;
    access_token: string;
    access_token_expires_at: number;
}

export const emailLogin = (data: emailLoginRequest):Promise<ApiResponse<emailLoginResponse>> =>{
    return service({
        url: '/user/emaillogin',
        method: 'post',
        data: data
    });
}

